<template>
  <view class="agreement-view"><web-view :src="webUrl"></web-view></view>
</template>

<script setup>
import { ref } from "vue";
import { onLoad } from "@dcloudio/uni-app";
const webUrl = ref("");
const protocol = "http://106.55.78.26:1280/help/protocol.php"; //用户协议
const policy = "http://106.55.78.26:1280/help/policy.php"; //隐私政策
const vip = "https://api-wood.kaying.cc/vip_protocol.html"; // 会员服务协议

onLoad((options) => {
  if (options && options.type) {
    let title = "";
    if (options.type === "protocol") {
      webUrl.value = protocol;
      title = "用户协议";
    } else if (options.type === "policy") {
      webUrl.value = policy;
      title = "隐私政策";
    } else if (options.type == "vip") {
      webUrl.value = vip;
      title = "会员服务协议";
    }
    uni.setNavigationBarTitle({
      title,
    });
  }
});
</script>
<style>
.agreement-view {
}
</style>
